package com.music.service.impl;

import com.music.common.BaseResult;
import com.music.dao.CmMusicDaoMapper;
import com.music.entity.CmMusic;
import com.music.service.CmMusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 2 * @Author: 刘佳乐 :面向百度编程
 * 3 * @Date: 2020/12/17 16:45
 * 4
 */
@Service
public class CmMusicServiceImpl implements CmMusicService {

    @Autowired
    CmMusicDaoMapper cmMusicDaoMapper;

    @Override
    public BaseResult findById(Integer uId) {
        CmMusic byId = cmMusicDaoMapper.findById(uId);
        BaseResult baseResult=new BaseResult();
        if(byId!=null){
            baseResult.setCode(200);
            baseResult.setMessage("查找成功");
            baseResult.setData(byId);
            return baseResult;
        }
        baseResult.setCode(201);
        baseResult.setMessage("查找失败");
        return null;
    }
}
